# -*- coding: utf-8 -*-
# 使用openai-python库，使用本地ollama部署的deepseek-r1:1.5b模型
# 简单对话
from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1" ,api_key="deepseek-r1:1.5b")

response = client.chat.completions.create(
    model="deepseek-r1:1.5b",
    messages=[{"role": "user", "content": "你好，你叫什么名字？ 你是谁创造的？"}]
)

print(response)
print(response.choices[0].message.content)